import math

# 计算圆的面积和周长
class Circle:
    def __init__(self, radius):
        self.r = radius

    # 计算圆的面积
    def get_area(self):
        return  math.pi * self.r ** 2

    # 计算圆的周长
    def get_perimeter(self):
        return 2 * math.pi * self.r


if __name__ == '__main__':
    radius = 0
    while True:
        try:
            radius = eval(input("输入圆的半径："))
            break
        except:
            print("输入有误，请重新输入！")
    # 创建对象
    c1 = Circle(float(radius))
    print("圆的面积为：%.2f" % c1.get_area())
    print("圆的周长为：%.2f" % c1.get_perimeter())